﻿using System.Configuration.Provider;
using NCMIS.ObjectModel;
using NCMIS.Produce;

namespace NCMIS.Provider
{
    /// <summary>
    /// Provides the base implementation for the Discovery Provider for the Discovery Services.
    /// </summary>
    public abstract class DiscoveryProviderBase : ProviderBase
    {
        /// <summary>
        /// When implemented in a derived class, executes a CMIS query statement against the contents of the Repository.
        /// </summary>
        /// <param name="repositoryId">the id of the repository.</param>
        /// <param name="statement">CMIS query statement to be executed.</param>
        /// <param name="searchAllVersions">If true, then the repository must include latest and non-latest versions of document objects in the query
        /// search scope. If false, then the repository must only include lastest versions of documents in the query search scope.</param>
        /// <param name="includeAllowableActions">If true, then the the available actions for each object in the result set must be returned.</param>
        /// <param name="includeRelationships">Value indicating what relationships in which the objects returned participate that must be returned, if any.</param>
        /// <param name="renditionFilter">Renditions whose kind matches this filter must be returned.</param>
        /// <param name="maxItems">The maximum number of items to return in the response.</param>
        /// <param name="skipCount">The number of potential results to skip before returning any results.</param>
        public abstract CmisObjectList Query(string repositoryId, string statement, bool searchAllVersions, bool includeAllowableActions, IncludeRelationships includeRelationships, string renditionFilter, string maxItems, string skipCount);

        /// <summary>
        /// When implemented in a derived class, gets a list of content changes. This service is intended to be used by search crawlers or other applications that need to efficiently
        /// understand what has changed in the repository.
        /// </summary>
        /// <param name="repositoryId">The id of the repository.</param>
        /// <param name="changeToken"> If specified, then the Repository must return the change event corresponding to the value of the specified change log token
        /// as the first result in the output.  If not specified, then the Repository must return the first change event recorded in the change log.</param>
        /// <param name="includeProperties">If true, then the Repository must include the updated property values for “updated” change events.  If false (default),
        /// then the Repository must not include the updated property values for "updated" change events. The single exception to this is that the objectId must always
        /// be included.</param>
        /// <param name="includePolicyIds">If true, then the Repository must include the IDs of Policies applied to the object referenced in each change event, if the change
        /// event modified the set of policies applied to the object.</param>
        /// <param name="includeAcl">If true, then the repository must return the ACLs for each object in the result set.</param>
        /// <param name="maxItems">The maximum number of items to return in the response.</param>
        /// <returns></returns>
        public abstract TokenedCmisObjectList GetContentChanges(string repositoryId, string changeToken, bool includeProperties, bool includePolicyIds, string filter, bool includeAcl, string maxItems);
    }
}
